import { createApp } from "vue";
import pinia from "./stores";
import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "element-plus/dist/index.css";
import App from "./App.vue";
import router from "./router";
import "./styles/index.scss";
import ElSvg from "./components/SvgIcon/ElSvg";
import "./permission";
// 引入百度地图插件
import BaiduMap from "vue-baidu-map-3x";

const app = createApp(App);
ElSvg(app);
//全局引入vxe-table
import VXETable from "vxe-table";
import "vxe-table/lib/style.css";
// font css
import "@/assets/fonts/font.scss";
// 引入echarts插件
import { vueEcharts } from "@/plugins/chart";
// 引入自定义指令 -> 图片懒加载
import imgPlugin from "@/directives/lazyImg.ts";
// 进度条显示
import "nprogress/nprogress.css"; // 这个nprogress样式必须引入
// 引入在线编辑器编辑器插件
import { QuillEditor } from "@vueup/vue-quill";
import "@vueup/vue-quill/dist/vue-quill.snow.css";
import JsPDF from "jspdf";


app.component("QuillEditor", QuillEditor);
// 注册三级分类公共组建
import CategorySelector from "@/components/CategorySelector/index.vue";
// 注册省市区组建
import UserCascader from "@/components/UserCascader/index.vue";
// 引入公共组件CommonCard（首页使用）
import CommonCard from "@/views/home/components/CommonCard.vue";
// 引入封装的按钮权限管理指令
import has from "@/directives/has";
// 引入百度地图插件
app.component(CommonCard.name, CommonCard);
app.component("CategorySelector", CategorySelector);
app.component("UserCascader", UserCascader);
app
  .use(pinia)
  .use(VXETable)
  .use(router)
  .use(imgPlugin)
  .use(JsPDF as any)
  .use(ElementPlus, {
    locale: zhCn,
  })
  .use(has)
  .use(vueEcharts)
  .use(BaiduMap as any, { ak: "oyva8hEbGyySeHenlvpaPYgbblTWU2mA" })
  .mount("#app");